package com.navinfo.opentsp.platform.computing.analysis.entity.disconnectedVehicle;

public class OutStatusDto {
    private byte status = 0;
    /** 电瓶亏电 */
    private static final byte BIT_DPKD = 0x1;
    /** 用户改装 */
    private static final byte BIT_YHGZ = 0x2;
    /** 信号弱 */
    private static final byte BIT_XHR = 0x4;
    /** 异常断连 */
    private static final byte BIT_YCDL = 0x8;
    /** 长停断连 */
    private static final byte BIT_CTDL = 0x10;
    private long alarm = 0;

    public boolean isLackOfElectricity() { return (status & BIT_DPKD) > 0; }
    public boolean isModified() { return (status & BIT_YHGZ) > 0; }
    public boolean isPoorSignal() { return (status & BIT_XHR) > 0; }
    public boolean isAbnormalDisconnection() { return (status & BIT_YCDL) > 0; }
    public boolean isLongStayDisconnection() { return (status & BIT_CTDL) > 0; }

    public void setLackOfElectricity() { status |= BIT_DPKD; }
    public void setModified() { status |= BIT_YHGZ; }
    public void setPoorSignal() { status |= BIT_XHR; }
    public void setAbnormalDisconnection() { status |= BIT_YCDL; }
    public void setLongStayDisconnection() { status |= BIT_CTDL; }

    public long getAlarm() { return alarm; }
    public void setAlarm(long alarm) { this.alarm = alarm; }

    /** 已出现欠压报警 */
    private int undervoltageFlag = 0;
    /** 上一个点信号强度 */
    private int lastSignalStrength = 0;
    /** 上一个点转速 */
    private int lastRotation = 0;
    /** 上上一个点转速 */
    private int lastRotation2 = 0;
    /** 是否为最后一个点 */
    private boolean isLast = false;

    public int getUndervoltageFlag() { return undervoltageFlag; }
    public void setUndervoltageFlag(int undervoltageFlag) { this.undervoltageFlag = undervoltageFlag; }
    public int getLastSignalStrength() { return lastSignalStrength; }
    public void setLastSignalStrength(int lastSignalStrength) { this.lastSignalStrength = lastSignalStrength; }
    public int getLastRotation() { return lastRotation; }
    public void setLastRotation(int lastRotation) { this.lastRotation = lastRotation; }
    public int getLastRotation2() { return lastRotation2; }
    public void setLastRotation2(int lastRotation2) { this.lastRotation2 = lastRotation2; }
    public boolean isLast() { return isLast; }
    public void setLast(boolean last) { isLast = last; }
}
